<template>
	<view class="recommend">
	<!-- 	{{recommend}} -->
	<template v-for="(item,i) in recommend" :key="i">
		<view class="item"  @click="imagClick(item.link)">
			<image class="img" :src="item.pic" mode="widthFix"></image>
		<!-- 	<text>{{item.title}}</text> -->
		</view>
	</template>
	
	</view>
</template>

<script setup>
	defineProps({
		recommend:{
			type:Array,
			default:()=>[]
		}
	})
	const emit=defineEmits(['itemClick'])
	function imagClick(link){
		console.log(111);
		emit('itemClick',link)
	}
</script>

<style lang="scss">
	.recommend{
		// 样式的抽取
	    @include normalFlex();
		margin-top: 10rpx;
		padding: 0 10rpx;
		.img{
			width: 150rpx;
			height: 150rpx;
		}
	}
</style>